<template>
	<view class="container">
		<!-- 头部安全距离 -->
		<view class="status_bar"></view>
		<!-- 支付金额提醒 -->
		<view class="pay_tip">
			<view class="pay_tip_title margin-b30">支付金额</view>
			<view class="pay_tip_money">
				<u-icon name="rmb" size="24"></u-icon>
				<view class="">{{nftPrice}}</view>
			</view>
		</view>
		<!-- 支付方式 -->
		<view class="pay_methods">
			<view class="pay_methods_title margin-b30">选择支付方式</view>
			<view class="tools" @tap="payment('fs')">
				<image src="../../static/images/nft/hyPay.png" mode="" style="width: 60rpx; height: 60rpx;"></image>
				<view class="tools_title">火源支付</view>
				<radio :checked="payType=='fs'" color="var(--echo-main-color)" />
			</view>
			<view class="division_line"></view>
			<view class="tools" @tap="payment('weChat')">
				<u-icon name="weixin-fill" size="30px"></u-icon>
				<view class="tools_title">微信支付</view>
				<radio :checked="payType=='weChat'" color="var(--echo-main-color)" />
			</view>
		</view>
		<!-- 确认支付 -->
		<u-button :text="paymentBtnText" color="var(--echo-main-color)" class="pay_btn" @click="submitPay"
			:disabled="isdisabled">
		</u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nftSerialNo: '',
				nftPrice: '',
				payType: "weChat",
				paymentBtnText: '确认支付',
				isdisabled: false
			}
		},
		onLoad({
			serialNo,
			price
		}) {
			this.nftSerialNo = serialNo;
			this.nftPrice = price;
		},

		methods: {
			payment(payType) {
				this.payType = payType
				if (payType == 'weChat') {
					this.paymentBtnText = '确认支付',
						this.isdisabled = false
					return
				}
				this.paymentBtnText = '支付方式正在开发',
					this.isdisabled = true
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		min-height: 100vh;
		background: $echo-nft-bg-color;
		color: #fff;
		padding: 0 40rpx;

		// 顶部安全距离
		.status_bar {
			height: var(--status-bar-height);
		}

		// 支付金额提醒
		.pay_tip {
			text-align: center;
			padding: 100rpx 0;

			&_title {
				font-size: 32rpx;
			}

			&_money {
				display: flex;
				justify-content: center;
				align-items: center;
				font-size: 48rpx
			}
		}

		// 支付方式
		.pay_methods {

			&_title {
				font-size: 32rpx;
			}

			.division_line {
				height: 1rpx;
				background-color: #eee;
				margin: 40rpx 0;
			}

			.tools {
				display: flex;
				justify-content: space-between;
				align-items: center;

				.tools_title {
					width: 65%;
				}
			}
		}

		// 支付按钮
		.pay_btn {
			margin-top: 60rpx;
		}

	}
</style>
